package com.bw.goods_module.home.adapter;

import android.widget.ImageView;

import com.bw.goods_module.R;
import com.bw.goods_module.home.GoodsEntity;
import com.bw.imgload_sdk.LoadImgUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

public class GoodsAdapter extends BaseQuickAdapter<GoodsEntity, BaseViewHolder> {

    public GoodsAdapter() {
        super(R.layout.item_home_goods);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, GoodsEntity goodsEntity) {
        baseViewHolder.setText(R.id.mGoodsDetailItemPriceTv,"￥"+goodsEntity.goods_default_price);
        baseViewHolder.setText(R.id.mGoodsDetailItemTitleTv,goodsEntity.goods_desc);
        ImageView img = baseViewHolder.getView(R.id.mGoodsDetailItemIv);
        LoadImgUtils.loadMatchImg(goodsEntity.goods_default_icon,img);
    }
}
